import { CommonModule } from "@angular/common";
import { NgModule, Type } from "@angular/core";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { RouterModule } from "@angular/router";
import { NzSafeAny } from "ng-zorro-antd/core/types";
import { NgPipesModule } from "ngx-pipes";
import { BaseRouterProgressBarComponent } from "./component/base";
import { DelayedInputDirective, ModelDelayDirective, VarDirective } from "./directive";
import { IconsProviderModule } from "./icons-provider.module";
import { NG_ZORRO_ANTD_MODULES } from "./ng-zorro-antd.module";
import { CostTimePipe, CurrencyRmbPipe } from "./pipe";
import { NgxTinymceModule } from "ngx-tinymce";

const MODULES: Array<Type<NzSafeAny>> = [NgPipesModule, NgxTinymceModule];
const PIPES: Array<Type<NzSafeAny>> = [CostTimePipe, CurrencyRmbPipe];
const DIRECTIVES: Array<Type<NzSafeAny>> = [DelayedInputDirective, ModelDelayDirective, VarDirective];
const COMPONENTS: Array<Type<NzSafeAny>> = [BaseRouterProgressBarComponent];

@NgModule({
	imports: [
		CommonModule,
		FormsModule,
		RouterModule,
		ReactiveFormsModule,
		IconsProviderModule,

		...MODULES,
		...NG_ZORRO_ANTD_MODULES,
	],
	declarations: [
		...PIPES, ...DIRECTIVES, ...COMPONENTS
	],
	exports: [
		CommonModule,
		FormsModule,
		ReactiveFormsModule,
		RouterModule,

		...MODULES,
		...NG_ZORRO_ANTD_MODULES,
		...PIPES,
		...DIRECTIVES,
		...COMPONENTS
	]
})
export class ShareModule { }